package com.zhan.utils.log.config;

import cn.com.chinatelecom.callcenter.utils.log.service.MessageService;
import cn.com.chinatelecom.callcenter.utils.log.service.impl.MessageServiceImpl;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author baishangbing
 * @date 2019/12/19 10:05
 */
@Configuration
@ConditionalOnClass(RedissonClient.class)
public class MessageConfig {
    @Autowired(required = false)
    private RedissonClient redissonClient;

    @Bean
    public MessageService messageService() {
        return new MessageServiceImpl(redissonClient);
    }
}
